package com.kzj.service.jpaRepository;

import com.kzj.pojo.CourseStudent;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

public interface CourseStudentJpaRepository extends JpaRepository<CourseStudent,Long> {
    public CourseStudent getCourseStudentByCourseIdAndStudentId(Long courseId,Long studentId);
    public List<CourseStudent> getCourseStudentsByCourseId(Long courseId);
    public List<CourseStudent> getCourseStudentsByStudentId(Long studentId);
    @Modifying
    @Transactional
    public void deleteCourseStudentByCourseIdAndStudentId(Long courseId,Long studentId);
    public List<CourseStudent> getCourseStudentByCourseId(Long courseId);
    public List<CourseStudent> getCourseStudentByCourseIdAndTerm(Long courseId,Integer term);
    public List<CourseStudent> getCourseStudentByStudentId(Long studentId);
    public List<CourseStudent> getCourseStudentsByCourseIdIn(List<Long> courseIds);

}
